package com.zige.zige.view;

import android.annotation.TargetApi;
import android.os.Build;
import android.view.View;

public class Utils {
	public static final int Immersionstate =
	// 只隐藏状态栏等，但还占地方，是原来显示区为白色（布局本身背景色，可手动改变）
	// View.SYSTEM_UI_FLAG_LAYOUT_STABLE
	// 布局拉伸但是虚拟按键显示
	// | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
	// 布局拉伸但是状态栏还显示
	// | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
	 View.SYSTEM_UI_FLAG_IMMERSIVE|
	// 布局拉伸，虚拟按键隐藏
	View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
	// 布局拉伸，状态栏隐藏
			| View.SYSTEM_UI_FLAG_FULLSCREEN;
			// 粘性沉浸模式
//			| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
	public static final int UnImmersionstate = 0;
	public static final int WithActionBar = 0;
	public static View mDecorView;

	/**
	 * 进入沉浸模式
	 * 
	 * @param mDecorView
	 */
	@TargetApi(Build.VERSION_CODES.HONEYCOMB)
	public static void setImmersion() {
		mDecorView.setSystemUiVisibility(Immersionstate);
	}

	@TargetApi(Build.VERSION_CODES.HONEYCOMB)
	public static void setImmersion(View v) {
		v.setSystemUiVisibility(Immersionstate);
	}
	@TargetApi(Build.VERSION_CODES.HONEYCOMB)
	public static void setUnImmersion(View v) {
		v.setSystemUiVisibility(UnImmersionstate);
	}
}
